<?php
$params = array_merge(
    require(__DIR__ . '/../../../common/config/params.php'),
    //require(__DIR__ . '/../../common/config/params-local.php'),
    require(__DIR__ . '/params.php')
    //require(__DIR__ . '/params-local.php')
);

return [
    'id' => 'app-supplier',
    'name'=>'supplier-application',
    'defaultRoute'=>"user/login",
    'basePath' => dirname(__DIR__),
    'bootstrap' => ['log'],
    'controllerNamespace' => 'app_supplier\controllers',
 
    'components' => [

        'request' => [
            'csrfParam' => '_csrf-frontend',
            'cookieValidationKey' => 'supplier-list-my',
            'enableCsrfValidation'=>false,

        ],
        'user' => [
            'identityClass' => 'app_supplier\models\User',
            'loginUrl'=>'user/login',
            'enableAutoLogin' => true,
            'identityCookie' => [
                'name' => 'backend_identity'
            ]
        ],
        'cache'=>[
            'class'=>'yii\caching\FileCache'
        ],
        'db'=>require_once (__DIR__.'/db.php'),
        'session' => [
            // this is the name of the session cookie used for login on the frontend
            'name' => 'advanced-frontend',
            //'autoStart'=>true
        ],
        'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning'],
                    'logFile'=>'../runtime/logs/'.date('Ymd',time()).'/'.date('H.i',time()).'.log'
                ],
            ],
        ],
//        'errorHandler' => [
//            'errorAction' => 'error/index',
//        ],
        'urlManager' => [
            //'urlFormat'=>'path',
            'enablePrettyUrl' => true,//开启URL美化
            'showScriptName' => false,//禁用index.php文件
            'rules' => [
                "<module:\w+>/<controller:\w+>/<action:\w+>/<id:\d+>"=>"<module>/<controller>/<action>",
                "<controller:\w+>/<action:\w+>/<id:\d+>"=>"<controller>/<action>",
                "<controller:\w+>/<action:\w+>"=>"<controller>/<action>",
            ]
        ],
        'assetManager'=>[

        ]

    ],

    'params' => $params,
];
